<?php
//SANITIZE ALL ESCAPES
$sanitize_all_escapes = true;
//
//STOP FAKE REGISTER GLOBALS
$fake_register_globals = false;
//

$ignoreAuth = true;
require_once('../interface/globals.php');
require_once("$srcdir/patient.inc");
require_once("history.inc.php");
require_once("$srcdir/options.inc.php");
require_once("$srcdir/acl.inc");
?>
<html>
    <head>
        <script type="text/javascript">
            $(document).ready(function(){
                tabbify();
            });
        </script>

        <style type="text/css">
        </style>

    </head>
    <body class="body_top">

<?php
$thisauth = true;
if ($thisauth) {
    $tmp = getPatientData($pid, "squad");
    if ($tmp['squad'] && !acl_check('squads', $tmp['squad']))
        $thisauth = 0;
}
if (!$thisauth) {
    echo "<p>(" . htmlspecialchars(xl('History not authorized'), ENT_NOQUOTES) . ")</p>\n";
    echo "</body>\n</html>\n";
    exit();
}

$result = getHistoryData($pid);
if (!is_array($result)) {
    newHistoryData($pid);
    $result = getHistoryData($pid);
}
?>

        <!--
        <div class="wrapper_clinico_meds">
            <h1>
                        <span class="title"><?php echo htmlspecialchars(xl('Patient History / Lifestyle'), ENT_NOQUOTES); ?></span>
                        <a href="history_full.php" class="css_button">
                                <span><?php echo htmlspecialchars(xl("Edit"), ENT_NOQUOTES); ?></span>
                        </a>
                </h1>
        </div>
        -->
        <div class='wrapper_historial'>
            <table>
                <tr>
                    <td>
                        <!-- Demographics -->
                        <div id="HIS">
                            <ul class="tabNav">
<?php display_layout_tabs('HIS', $result, $result2); ?>
                            </ul>
                            <div class="tabContainer">
                                <?php display_layout_tabs_data('HIS', $result, $result2); ?>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>

    </body>
</html>
